import { IPSSysSFPlugin } from '../res/ipssys-sfplugin';
import { IPSSubSysServiceAPI } from './ipssub-sys-service-api';
import { IPSSubSysServiceAPIDE } from './ipssub-sys-service-apide';
import { IPSSubSysServiceAPIDEMethod } from './ipssub-sys-service-apidemethod';
import { IPSSubSysServiceAPIMethod } from './ipssub-sys-service-apimethod';
import { IPSSubSysServiceAPIMethodInput } from './ipssub-sys-service-apimethod-input';
import { IPSSubSysServiceAPIMethodReturn } from './ipssub-sys-service-apimethod-return';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSSubSysServiceAPIMethodImpl extends PSModelObjectImpl implements IPSSubSysServiceAPIDEMethod, IPSSubSysServiceAPIMethod {
  get actionType(): string {
    return this.M.actionType;
  }

  get afterCode(): string {
    return this.M.afterCode;
  }

  get bodyContentType(): 'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/xml' | 'USER' | 'USER2' | 'USER3' | 'USER4' {
    return this.M.bodyContentType;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get codeName2(): string {
    return this.M.codeName2;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  protected inpssubsysserviceapide: IPSSubSysServiceAPIDE | null = null;

  getInPSSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    if (this.inpssubsysserviceapide != null) return this.inpssubsysserviceapide;
    const value = this.M.getInPSSubSysServiceAPIDE;
    if (value == null) {
      return null;
    }
    const ipssubsysserviceapi = this.getParentPSModelObject('service.IPSSubSysServiceAPI') as IPSSubSysServiceAPI;
    if (ipssubsysserviceapi != null) {
      this.inpssubsysserviceapide = ipssubsysserviceapi.findPSSubSysServiceAPIDE(value);
    }
    return this.inpssubsysserviceapide;
  }

  get inPSSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    return this.getInPSSubSysServiceAPIDE();
  }

  getInPSSubSysServiceAPIDEMust(): IPSSubSysServiceAPIDE {
    const value = this.getInPSSubSysServiceAPIDE();
    if (value == null) {
      throw new Error('未指定输入对象');
    }
    return value;
  }

  get keyField(): string {
    return this.M.keyField;
  }

  get memo(): string {
    return this.M.memo;
  }

  get methodParam(): string {
    return this.M.methodParam;
  }

  get methodParam2(): string {
    return this.M.methodParam2;
  }

  get methodScriptCode(): string {
    return this.M.methodScriptCode;
  }

  get methodTag(): string {
    return this.M.methodTag;
  }

  get methodTag2(): string {
    return this.M.methodTag2;
  }

  get methodType(): 'DEACTION' | 'FETCH' | 'SELECT' | 'FETCHTEMP' | 'SELECTTEMP' | 'USER' | 'USER2' | 'USER3' | 'USER4' {
    return this.M.methodType;
  }

  get name(): string {
    return this.M.name;
  }

  protected outpssubsysserviceapide: IPSSubSysServiceAPIDE | null = null;

  getOutPSSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    if (this.outpssubsysserviceapide != null) return this.outpssubsysserviceapide;
    const value = this.M.getOutPSSubSysServiceAPIDE;
    if (value == null) {
      return null;
    }
    const ipssubsysserviceapi = this.getParentPSModelObject('service.IPSSubSysServiceAPI') as IPSSubSysServiceAPI;
    if (ipssubsysserviceapi != null) {
      this.outpssubsysserviceapide = ipssubsysserviceapi.findPSSubSysServiceAPIDE(value);
    }
    return this.outpssubsysserviceapide;
  }

  get outPSSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    return this.getOutPSSubSysServiceAPIDE();
  }

  getOutPSSubSysServiceAPIDEMust(): IPSSubSysServiceAPIDE {
    const value = this.getOutPSSubSysServiceAPIDE();
    if (value == null) {
      throw new Error('未指定输出对象');
    }
    return value;
  }

  get psDECodeName(): string {
    return this.M.getPSDECodeName;
  }

  getPSDECodeName(): string {
    return this.M.getPSDECodeName;
  }

  get psDELogicName(): string {
    return this.M.getPSDELogicName;
  }

  getPSDELogicName(): string {
    return this.M.getPSDELogicName;
  }

  get psDEName(): string {
    return this.M.getPSDEName;
  }

  getPSDEName(): string {
    return this.M.getPSDEName;
  }

  protected pssubsysserviceapide: IPSSubSysServiceAPIDE | null = null;

  getPSSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    if (this.pssubsysserviceapide != null) return this.pssubsysserviceapide;
    const value = this.M.getPSSubSysServiceAPIDE;
    if (value == null) {
      return null;
    }
    const ipssubsysserviceapi = this.getParentPSModelObject('service.IPSSubSysServiceAPI') as IPSSubSysServiceAPI;
    if (ipssubsysserviceapi != null) {
      this.pssubsysserviceapide = ipssubsysserviceapi.findPSSubSysServiceAPIDE(value);
    }
    return this.pssubsysserviceapide;
  }

  get psSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    return this.getPSSubSysServiceAPIDE();
  }

  getPSSubSysServiceAPIDEMust(): IPSSubSysServiceAPIDE {
    const value = this.getPSSubSysServiceAPIDE();
    if (value == null) {
      throw new Error('未指定外部接口实体对象');
    }
    return value;
  }

  protected pssubsysserviceapimethodinput: IPSSubSysServiceAPIMethodInput | null = null;

  getPSSubSysServiceAPIMethodInput(): IPSSubSysServiceAPIMethodInput | null {
    if (this.pssubsysserviceapimethodinput != null) return this.pssubsysserviceapimethodinput;
    const value = this.M.getPSSubSysServiceAPIMethodInput;
    if (value == null) {
      return null;
    }
    this.pssubsysserviceapimethodinput = this.getPSModel4('service.IPSSubSysServiceAPIMethodInput', value, 'getPSSubSysServiceAPIMethodInput') as IPSSubSysServiceAPIMethodInput;
    return this.pssubsysserviceapimethodinput;
  }

  get psSubSysServiceAPIMethodInput(): IPSSubSysServiceAPIMethodInput | null {
    return this.getPSSubSysServiceAPIMethodInput();
  }

  getPSSubSysServiceAPIMethodInputMust(): IPSSubSysServiceAPIMethodInput {
    const value = this.getPSSubSysServiceAPIMethodInput();
    if (value == null) {
      throw new Error('未指定方法输入对象');
    }
    return value;
  }

  protected pssubsysserviceapimethodreturn: IPSSubSysServiceAPIMethodReturn | null = null;

  getPSSubSysServiceAPIMethodReturn(): IPSSubSysServiceAPIMethodReturn | null {
    if (this.pssubsysserviceapimethodreturn != null) return this.pssubsysserviceapimethodreturn;
    const value = this.M.getPSSubSysServiceAPIMethodReturn;
    if (value == null) {
      return null;
    }
    this.pssubsysserviceapimethodreturn = this.getPSModel4('service.IPSSubSysServiceAPIMethodReturn', value, 'getPSSubSysServiceAPIMethodReturn') as IPSSubSysServiceAPIMethodReturn;
    return this.pssubsysserviceapimethodreturn;
  }

  get psSubSysServiceAPIMethodReturn(): IPSSubSysServiceAPIMethodReturn | null {
    return this.getPSSubSysServiceAPIMethodReturn();
  }

  getPSSubSysServiceAPIMethodReturnMust(): IPSSubSysServiceAPIMethodReturn {
    const value = this.getPSSubSysServiceAPIMethodReturn();
    if (value == null) {
      throw new Error('未指定方法返回对象');
    }
    return value;
  }

  protected pssyssfplugin: IPSSysSFPlugin | null = null;

  getPSSysSFPlugin(): IPSSysSFPlugin | null {
    if (this.pssyssfplugin != null) return this.pssyssfplugin;
    const value = this.M.getPSSysSFPlugin;
    if (value == null) {
      return null;
    }
    this.pssyssfplugin = this.getPSModel4('res.IPSSysSFPlugin', value, 'getPSSysSFPlugin') as IPSSysSFPlugin;
    return this.pssyssfplugin;
  }

  get psSysSFPlugin(): IPSSysSFPlugin | null {
    return this.getPSSysSFPlugin();
  }

  getPSSysSFPluginMust(): IPSSysSFPlugin {
    const value = this.getPSSysSFPlugin();
    if (value == null) {
      throw new Error('未指定后端扩展插件');
    }
    return value;
  }

  get requestField(): string {
    return this.M.requestField;
  }

  get requestMethod(): 'GET' | 'HEAD' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'TRACE' {
    return this.M.requestMethod;
  }

  get requestParamType(): 'NONE' | 'FIELD' | 'FIELDS' | 'ENTITY' | 'ENTITIES' | 'OBJECT' | 'OBJECTS' {
    return this.M.requestParamType;
  }

  get requestPath(): string {
    return this.M.requestPath;
  }

  get returnValueType(): 'VOID' | 'SIMPLE' | 'SIMPLES' | 'ENTITY' | 'ENTITIES' | 'OBJECT' | 'OBJECTS' | 'LINKENTITY' | 'LINKENTITIES' | 'ASYNCACTION' | 'SSE' | 'USER' | 'USER2' {
    return this.M.returnValueType;
  }

  get uniqueTag(): string {
    return this.M.uniqueTag;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get autoPath(): boolean {
    return this.M.autoPath != null ? this.M.autoPath : false;
  }

  get needResourceKey(): boolean {
    return this.M.needResourceKey != null ? this.M.needResourceKey : false;
  }

  get noServiceCodeName(): boolean {
    return this.M.noServiceCodeName != null ? this.M.noServiceCodeName : false;
  }

  get cls(): string {
    return 'PSSubSysServiceAPIMethodImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'service.IPSSubSysServiceAPIDEMethod' || cls == 'service.IPSSubSysServiceAPIMethod') return true;
    return super.instanceof(cls);
  }
}
